package com.bs.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.bs.bean.Product;
import com.bs.dao.ProductDAO;

public class ProductDAOImpl extends SqlMapClientDaoSupport implements ProductDAO {

	@Override
	public int delete(Product product) {
		return this.getSqlMapClientTemplate().delete("product.delete",product);
	}

	
	@Override
	public int batchDelete(String ids) {
		return this.getSqlMapClientTemplate().delete("product.batchDelete",ids);
	}


	@Override
	public void save(Product product){
		this.getSqlMapClientTemplate().insert("product.save", product);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Product> findAllTypes() {
		return this.getSqlMapClientTemplate().queryForList("product.findAllTypes");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Product> query(Product product) {
		return this.getSqlMapClientTemplate().queryForList("product.query",product);
	}
}
